/* 响应式设计 */

/* 中等屏幕优化 */
@media (max-width: 1200px) {
  .chat-container {
    width: 98%;
    max-width: none;
  }

  .bot-message,
  .welcome-message .message-content {
    max-width: 92%;
    width: 92%;
  }
  
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
  }
}

/* 小屏幕优化 */
@media (max-width: 480px) {
  .input-area {
    padding: 12px 16px;
  }

  .input-container {
    padding: 6px 10px;
    border-radius: 20px;
    gap: 8px;
    max-width: calc(100vw - 48px);
    margin: 0 auto;
  }

  .message-input {
    font-size: 13px;
    max-height: 100px;
    min-height: 20px;
  }
  
  .messages {
    padding: 16px 24px;
  }
}

/* 移动端优化 */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    width: 260px;
    transition: transform 0.3s ease, width 0.3s ease;
  }
  
  .sidebar.hidden {
    transform: translateX(-100%);
    width: 0 !important;
    overflow: hidden;
  }
  
  .main-content {
    width: 100%;
    margin-left: 0;
  }
  
  .chat-container {
    margin-top: 0;
    border-radius: 0;
    width: 100%;
  }
  
  .input-container {
    max-width: calc(100vw - 64px);
  }
  
  .header {
    padding: 6px 16px;
  }
  
  .header-right {
    gap: 8px;
  }
  
  .sidebar-toggle {
    padding: 4px 8px;
    font-size: 14px;
  }
  
  .user-info {
    display: none;
  }
  
  .message-content {
    max-width: 90%;
  }

  .bot-message,
  .welcome-message .message-content {
    max-width: 92%;
    width: 92%;
  }

  .user-message {
    max-width: 80%;
    padding: 10px 14px;
    font-size: 13px;
  }
  
  .user-avatar,
  .bot-avatar {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .messages {
    padding: 16px 32px;
  }
  
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px;
  }
  
  .items-grid .item-card {
    padding: 8px !important;
    min-height: 45px !important;
  }

  .items-grid .item-name {
    font-size: 12px !important;
    margin-right: 20px !important;
  }

  .items-grid .item-number {
    width: 16px !important;
    height: 16px !important;
    font-size: 9px !important;
    top: 6px !important;
    right: 6px !important;
  }
  
  .item-similarity {
    font-size: 8px;
    padding: 1px 3px;
  }
  
  .item-tooltip {
    max-width: 280px;
    min-width: 250px;
  }
  
  .tooltip-header {
    padding: 10px 12px;
    font-size: 12px;
  }
  
  .tooltip-content {
    padding: 12px;
  }
  
  .messages {
    padding: 16px 44px;
  }
  
  .input-area {
    padding: 16px 20px 20px;
  }
  
  .input-container {
    padding: 8px 12px;
    border-radius: 24px;
    gap: 12px;
    max-width: calc(98vw - 88px);
    margin: 0 auto;
  }
  
  .message-input {
    font-size: 14px;
    max-height: 120px;
  }
  
}

/* 大屏幕优化 - 1200px到1600px */
@media (min-width: 1200px) and (max-width: 1599px) {
  .input-container {
    max-width: 1080px;
  }
}

/* 大屏幕优化 */
@media (min-width: 1400px) {
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
  }
  
  .items-grid .item-card {
    min-height: 65px !important;
    padding: 10px !important;
  }

  .items-grid .item-name {
    font-size: 12px !important;
  }

  .items-grid .item-number {
    width: 18px !important;
    height: 18px !important;
    font-size: 10px !important;
  }
  
  .item-similarity {
    font-size: 10px;
    padding: 2px 5px;
  }
}

/* 超大屏幕优化 */
@media (min-width: 1600px) {
  .chat-container {
    max-width: 1600px;
  }
  
  .input-container {
    max-width: 1480px;
  }
  
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
  }
}